package com.hjimi.ski.model.base;

import com.hjimi.ski.callback.BaseCallback;
import com.hjimi.ski.utils.HttpUtil;
import com.zhy.http.okhttp.callback.StringCallback;
import okhttp3.Call;
import okhttp3.Request;

/**
 * Created By 孙岩
 * on 2020/7/24.
 */
public class DeleteHeadModel extends BaseModel<String>{
    @Override
    public void execute(final BaseCallback<String> callback) {
        HttpUtil.requestDelete(url,token,new StringCallback() {
            @Override
            public void onError(Call call, Exception e, int id) {
                callback.onFailure(e.toString());
            }

            @Override
            public void onResponse(String response, int id) {
                callback.onSuccess(response);
            }

            @Override
            public void onBefore(Request request, int id) {
                callback.onBefore();
            }

            @Override
            public void onAfter(int id) {
                callback.onComplete();
            }
        },"1");
    }
}
